package lab03.test01.test04;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;

/**
 * Created by lenovo on 2017/12/12.
 */
public class Test {
    public static void main(String[] args) {
                String source = "D:\\dev";
                String target = "D:\\dev";

                        FileInputStream fileInputStream = null;
                        FileOutputStream fileOutputStream = null;

                       try {
                        fileInputStream = new FileInputStream(source);
                        fileOutputStream = new FileOutputStream(target);
                        int data ;

                                while ((data = fileInputStream.read()) != -1){
                                fileOutputStream.write(data);
                            }
                    } catch (FileNotFoundException e) {
                        e.printStackTrace();
                    } catch (IOException e) {
                        e.printStackTrace();
                    }finally {
                        try {
                                fileInputStream.close();
                            fileOutputStream.close();
                        } catch (IOException e) {
                                e.printStackTrace();
                            }
                    }
            }
 }

